package com.jdkreader.concurrency;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * 生产者消费者问题 Restaurant实体类
 */
public class Restaurant {

    public Meal meal;

    ExecutorService exec= Executors.newCachedThreadPool();

    WaitPerson waitPerson=new WaitPerson(this);

    Chef chef=new Chef(this);

    public Restaurant() {
        exec.execute(waitPerson);
        exec.execute(chef);
    }

    public static void main(String[] args){
        new Restaurant();
    }
}
